<?php
include ('include/config.php');
$section = $_GET['section'];
ob_start('changeData');
?>
<!DOCTYPE html>
<html lang="es">


<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<head>
    <meta charset="utf-8">
    <title>{{title}} - Alquiler y venta de propiedades en Occidente</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="{{description}}">
    <meta name="author" content="softteca.com">
    
    <!-- LOAD CSS FILES -->
    <link href="<?php echo PATH;?>css/main.css" rel="stylesheet" type="text/css">
    
    <!-- LOAD JS FILES -->
   
   	<script type="text/javascript" src="<?php echo PATH;?>scripts/jquery.js"></script>
    <script src="<?php echo PATH;?>js/bootstrap.min.js"></script>
    <script src="<?php echo PATH;?>js/jquery.isotope.min.js"></script>
    <script src="<?php echo PATH;?>js/jquery.prettyPhoto.js"></script>
    <script src="<?php echo PATH;?>js/easing.js"></script>
    <script src="<?php echo PATH;?>js/jquery.ui.totop.js"></script>
	<script src="<?php echo PATH;?>js/selectnav.js"></script>
    <script src="<?php echo PATH;?>js/ender.js"></script>
    <script src="<?php echo PATH;?>js/custom.js"></script>
    <script src="<?php echo PATH;?>js/responsiveslides.min.js"></script>
      <script>
    // You can also use "$(window).load(function() {"
    $(function () {
      // Slideshow 4
      $(".pic_slider").responsiveSlides({
        auto: false,
        pager: false,
        nav: true,
        speed: 500,
        namespace: "callbacks",
        before: function () {
          $('.events').append("<li>before event fired.</li>");
        },
        after: function () {
          $('.events').append("<li>after event fired.</li>");
        }
      });
    });
  </script>

</head>

<body>
	<!-- header begin -->
	<header>
    	<div class="container">
        	<div id="logo">
            	<div class="inner">
   	    		  <a href="index-2.html"><img src="<?php echo PATH;?>img/logo.png"></a>
            	</div>
            </div>
    
				<ul id="mainmenu">
                <li><a href="<?php echo PATH;?>" <?php if($section == ''  || $section == 'sitemap' || $section == '404'){ echo 'class="current"'; } ?>>Inicio</a></li>
				<li><a href="<?php echo PATH;?>occidente" <?php if($section == 'occidente'){ echo 'class="current"'; } ?>>Occidente</a></li>
				<li><a href="<?php echo PATH;?>alquileres" <?php if($section == 'alquileres' || $_GET['propiedad_tipo'] == 1){ echo 'class="current"'; } ?>>Alquileres</a></li>
				<li><a href="<?php echo PATH;?>ventas" <?php if($section == 'ventas' || $_GET['propiedad_tipo'] == 2){ echo 'class="current"'; } ?>>Ventas</a></li>
				<li><a href="<?php echo PATH;?>preguntas-frecuentes" <?php if($section == 'preguntas-frecuentes'){ echo 'class="current"'; } ?>>FAQ</a></li>
				<li><a href="<?php echo PATH;?>contacto" <?php if($section == 'contacto'){ echo 'class="current"'; } ?>>Contacto</a></li>
        </ul>
    
   	  </div>
    </header>
	<!-- header close -->
    
	<!-- featured begin -->
  <?php if ($section == ''  || $section == 'home' ) { ?>
	<section id="featured" data-speed="1" data-type="background">
    	<div class="container">
        	<div class="row">
            	<?php

                include('homespan.php');


                ?>
             
                         
              
             
            </div>
        </div>
    </section>
    <?php } ?>
	<!-- featured close -->
    
    
	<!-- search begin -->

  
   	<div id="search">
    	<div class="container">
        	<div class="row">
        	<span class="span2">Consiga su casa:</span>
          <?php if ($section == 'ventas'  || $section == 'alquileres' ) { ?>
            <form method="post" id="searchform" action="include/search.php" class="form-inline">
          <?php } else {?>
          <form method="post" id="searchform" action="../include/search.php" class="form-inline">
          <?php } ?>
            <div class="span2">
                <select id="proyecto_id" name="proyecto_id">
                    <option value="">Occidente</option>
                    <?php
                    
                    $proyectos = new proyectos;

                    try
                    {
                        foreach($proyectos->seleccionarTodos('ORDER BY proyecto_nombre') as $proyecto)
                        {
                            echo '<option value="'.$proyecto->proyecto_id.'">'.$proyecto->proyecto_nombre.'</option>';
                        }
                    }
                    catch(noResults $e)
                    {
                        echo '<option>No hay resultados.</option>';
                    }
                    ?>
                </select>
            </div>

            <div class="span2">
            <select id="propiedad_tipo" name="propiedad_tipo"><option value="">Ventas y alquileres</option><option value="1">Alquiler</option><option value="2">Venta</option></select>
            </div>

            <div class="span2">
            <select id="propiedad_habitaciones" name="propiedad_habitaciones"><option value="">Número de habitaciones</option><?php for($i = 1; $i <= 5; $i++){ echo '<option>'.$i.'</option>'; }?></select>
            </div>

            <div class="span2">
            <select id="propiedad_banios" name="propiedad_banios"><option value="">Número de baños</option><?php for($i = 1; $i <= 5; $i++){ echo '<option>'.$i.'</option>'; }?></select>
            </div>

            
             <div class="span2">
                
                <input type="submit" class="btn btn-info btn-search" id="buscar_enviar" value="Buscar" />
             </div>
        
            </form>
        	
      	</div>
      </div>
	</div>
  
	<!-- search close -->
    
	<!-- content begin -->
    <div id="content">
    	<div class="container">
      <?php if ($section == ''  || $section == 'home' ) {?>
        	<div class="row">
        <?php   }?>
            	<div class="span12">
            	 <?php if ($section == ''  || $section == 'home' ) {
                     echo '<h2 class="title">Las propiedades más recientes</h2> ';                 }?>
            	</div>
                
                <?php
			define('modulation', true);
			
			if(isset($section))
			{
	
				$section = $section;

				if(!empty($section) && $section != 'index')
				{
					if(file_exists($section.'.php') && preg_match('/^[a-zA-Z0-9\-\_]+$/', $section))
					{
						include($section.'.php');
					}
					else
					{
						include('home.php');
					}
				}
				else
				{
					include('home.php');
				}
			}
			else
			{
				include('home.php');
			}
			 if ($section == ''  || $section == 'home' ) { ?>
        </div>
       <?php  }?>
        
        </div>
        
    </div>
	<!-- content close -->
    
    
    
    
	<!-- footer begin -->
   	<footer>
   		<div class="container">
       	  <div class="row">
            	<div class="span3">
                	<h3>About Us</h3>
                    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
                </div>
                
                <div class="span3">
                	<h3>Photo Stream</h3>
                   <div id="flickr-photo-stream">
                        <script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=8&amp;display=latest&amp;size=s&amp;layout=x&amp;source=user&amp;user=52617155@N08"></script>
                        <div class="clearfix"></div>
                        </div>
                </div>
                
              <div class="span3">
               	<h3>Latest News</h3>
                <ul class="list-news"> 
                <li>
                	<img src="<?php echo PATH;?>img/thumbnail-1.jpg">
                    <div class="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor</div>
                </li>
                <li>
                	<img src="<?php echo PATH;?>img/thumbnail-1.jpg">
                    <div class="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor</div>
                </li>
                </ul>                </div>
               <div class="span3">
                	<h3>Follow Us</h3>
                    	<div class="social-icons">
                        	<a href="#"><img src="<?php echo PATH;?>img/social-icons/rss.png"/></a>
                        	<a href="#"><img src="<?php echo PATH;?>img/social-icons/facebook.png"/></a>
                        	<a href="#"><img src="<?php echo PATH;?>img/social-icons/twitter.png"/></a>
                        	<a href="#"><img src="<?php echo PATH;?>img/social-icons/gplus.png"/></a>
                        	<a href="#"><img src="<?php echo PATH;?>img/social-icons/youtube.png"/></a>
                        	<a href="#"><img src="<?php echo PATH;?>img/social-icons/vimeo.png"/></a>
                        </div>
                </div>
            </div>
        </div>
        
        <div class="subfooter">
        	<div class="container">
                <div class="row">
                    <div class="span6">
                    	<nav>
                          <ul>
                              <li><a href="#">Home</a></li>
                              <li><a href="#">Find a Home</a></li>
                              <li><a href="#">Blog</a></li>
                              <li><a href="#">About</a></li>
                              <li><a href="#">Services</a></li>
                              <li><a href="#">Contact</a></li>
                          </ul>
                        </nav>
                  </div>
                </div>
            </div>
        </div>
        
   	</footer>
	<!-- footer close -->
    <!-- Scripts -->
    
    <script type="text/javascript" src="<?php echo PATH;?>scripts/jquery.effectscore.js"></script>
    <script type="text/javascript" src="<?php echo PATH;?>scripts/jquery.color.js"></script>
    <script type="text/javascript" src="<?php echo PATH;?>scripts/functions.js"></script>

   
</body>


</html>
<?php
ob_end_flush();
?>